package com.cetc.controller;

import cn.hutool.core.collection.CollectionUtil;
import com.cetc.common.anno.CurAuthUser;
import com.cetc.controller.base.BaseController;
import com.cetc.entity.User;
import com.cetc.service.IUserService;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/user")
public class UserController extends BaseController {
    @Resource
    private IUserService userService;

    @RequestMapping(value = "login", method = RequestMethod.POST)
    public Map<String,Object> login(@RequestBody User user){
        Map<String,Object> reMap = new HashMap<>();
        reMap = userService.login(user);
        return reMap;
    }

    @RequestMapping(value = "getToken", method = RequestMethod.POST)
    public Map<String,Object> getToken(@CurAuthUser User user){
        Map<String,Object> reMap = new HashMap<>();

        System.out.println(user);
        return reMap;
    }


}
